Skip to content

Conversation

@Sola-ris
Copy link
Contributor

Summary

Call ripgrep with explicit UTF-8 encoding to prevent issues with multi-byte characters.

When calling subprocess.Popen, (which is where silent_subprocess::silent_run eventually ends up) with text=True without specifying the encoding, python will use the encoding returned by locale::getencoding.

On Linux this returns UTF-8 while on Windows it will return cp1252 which causes issues with multi-byte characters like em dashes or Japanese characters.
linux
win

Fixes #1195.

Before

before

I've omitted こんにちは.txt from the screenshot since it hangs the program with the error reported in #1195

After

after

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

Copy link
Collaborator

@Computerdores Computerdores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good, also very nice that you wrote a regression test

@CyanVoxel CyanVoxel added Type: Installation Installing, building, and/or launching the program Type: File System File system interactions Type: Tests Tests or testing related labels Nov 14, 2025
@CyanVoxel CyanVoxel moved this to 👀 In review in TagStudio Development Nov 14, 2025
@CyanVoxel CyanVoxel added this to the Alpha v9.5.x milestone Nov 14, 2025
@TrigamDev TrigamDev added the Type: Fix A fix for a bug, typo, or other issue label Jan 18, 2026
@CyanVoxel
Copy link
Member

Sorry for the delay on pulling this, and thank you so much for your work on this fix!

@CyanVoxel CyanVoxel merged commit 4c484bc into TagStudioDev:main Jan 23, 2026
5 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in TagStudio Development Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: File System File system interactions Type: Fix A fix for a bug, typo, or other issue Type: Installation Installing, building, and/or launching the program Type: Tests Tests or testing related

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Crash when adding file to library with Japanese filename

4 participants